package erlwitch.tree;

import java.util.ArrayList;
import java.util.Arrays;

public class TermTree extends Term {

	private ArrayList<Term> children;
	
	public TermTree(int begin, int end) {
		super(begin, end);
		children = new ArrayList<Term>();
	}

	public TermTree(int begin, int end, Term ... children) {
		super(begin, end);
		this.children = new ArrayList<Term>(Arrays.asList(children));
	}

	public TermTree(int begin, int end, ArrayList<Term> children) {
		super(begin, end);
		this.children = children;
	}
	
	public void addChild(Term t) {
		begin = t.getBegin();
		children.add(0, t);
	}

}
